package la.iok.hzsvn.lewin.movie.cloud.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

public class WxRes {
    @JsonProperty("errcode")
    private Integer errorCode;
    @JsonProperty("errmsg")
    private String errorMessage;

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    /**
     * 调用成功的时候,errorCode也可能是没有值的，并不一定都是0
     * @return 成功返回true,否则false
     */
    public boolean success() {
        return errorCode == null || Objects.equals(0,errorCode);
    }
}
